﻿@model DotaHelp.Models.Purchase

<div class="commentAutor">
    Мини дота гайд №@Model.Id 
    @Html.ShowUserName(Model.Author) @Model.Date      
    @Html.Raiting("Purchases", Model.Id, Model.Raiting)
    @Html.RouteLink("(обсудить)", "Purchase", new { id = Model.Id }, new { style = "margin-left:5px" })
    @Html.Delete("Purchases", Model.Id)
    </div>
    
@if ((bool)ViewData["ShowHero"])
{
    <div style="float:left">
        @Html.LinkOnHero(Model.Hero, isSmall: ViewData.ContainsKey("Small"))          
    </div>
}
<div style="@((bool)ViewData["ShowHero"] ? "margin-left:" + (ViewData.ContainsKey("Small")?40:80) + "px" : "")">            
    @foreach (var pitem in Model.PurchasesItems.OrderBy(_ => _.Position).SkipWhile(_ => _.ItemId == -1))
    {
        if (pitem.ItemId != -1)
        {
            @Html.LinkOnItem(pitem.Item, isSmall:ViewData.ContainsKey("Small")) 
        }
        else
        {
            <br />
        }
    }     
</div>   

@if ((bool?)ViewData["ShowCaption"] == true)
{   
    <div class="authorText">@Html.ReplaceKeyOnContent(Model.Comment, true)</div> 
}
@if ((bool?)ViewData["ShowComments"] == true)
{
    <div style="margin-left:20px">    
        @Html.CompactComments(Url.RouteUrl("Purchase", new { id = Model.Id }))          
    </div>
}